﻿using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;
using GalaSoft.MvvmLight;

namespace com.IronOne.BoardPACWinAppBO.General
{
    public class ProfileDataModel : ObservableObject
    {
        /// <summary>
        ///     The <see cref="UserOnlineStatus" /> property's name.
        /// </summary>
        public const string UserOnlineStatusPropertyName = "UserOnlineStatus";

        /// <summary>
        ///     The <see cref="ProfilePicPath" /> property's name.
        /// </summary>
        public const string ProfilePicPathPropertyName = "ProfilePicPath";

        /// <summary>
        ///     The <see cref="OnlineStatusColor" /> property's name.
        /// </summary>
        public const string OnlineStatusColorPropertyName = "OnlineStatusColor";

        /// <summary>
        ///     The <see cref="ButtonTag" /> property's name.
        /// </summary>
        public const string ButtonTagPropertyName = "ButtonTag";

        /// <summary>
        ///     The <see cref="ProgressBarVisibility" /> property's name.
        /// </summary>
        public const string ProgressBarVisibilityPropertyName = "ProgressBarVisibility";

        private bool _buttonTag;
        private string _onlineStatusColor = "";
        private BitmapImage _profilePicPath;
        private Visibility _progressBarVisibility = Visibility.Collapsed;
        private string _userOnlineStatus = "";
        public string DisplayName { get; set; }

        /// <summary>
        ///     Sets and gets the UserOnlineStatus property.
        ///     Changes to that property's value raise the PropertyChanged event.
        /// </summary>
        public string UserOnlineStatus
        {
            get { return _userOnlineStatus; }

            set
            {
                if (_userOnlineStatus == value)
                {
                    return;
                }

                _userOnlineStatus = value;
                RaisePropertyChanged(UserOnlineStatusPropertyName);
            }
        }

        /// <summary>
        ///     Sets and gets the ProfilePicPath property.
        ///     Changes to that property's value raise the PropertyChanged event.
        /// </summary>
        public BitmapImage ProfilePicPath
        {
            get { return _profilePicPath; }

            set
            {
                if (_profilePicPath == value)
                {
                    return;
                }

                _profilePicPath = value;
                RaisePropertyChanged(ProfilePicPathPropertyName);
            }
        }

        /// <summary>
        ///     Sets and gets the OnlineStatusColor property.
        ///     Changes to that property's value raise the PropertyChanged event.
        /// </summary>
        public string OnlineStatusColor
        {
            get { return _onlineStatusColor; }

            set
            {
                if (_onlineStatusColor == value)
                {
                    return;
                }

                _onlineStatusColor = value;
                RaisePropertyChanged(OnlineStatusColorPropertyName);
            }
        }

        /// <summary>
        ///     Sets and gets the ButtonTag property.
        ///     Changes to that property's value raise the PropertyChanged event.
        /// </summary>
        public bool ButtonTag
        {
            get { return _buttonTag; }

            set
            {
                if (_buttonTag == value)
                {
                    return;
                }

                _buttonTag = value;
                RaisePropertyChanged(ButtonTagPropertyName);
            }
        }

        /// <summary>
        ///     Sets and gets the ProgressBarVisibility property.
        ///     Changes to that property's value raise the PropertyChanged event.
        /// </summary>
        public Visibility ProgressBarVisibility
        {
            get { return _progressBarVisibility; }

            set
            {
                if (_progressBarVisibility == value)
                {
                    return;
                }

                _progressBarVisibility = value;
                RaisePropertyChanged(ProgressBarVisibilityPropertyName);
            }
        }

        //public string OfflineTimer { get; set; }
        /// <summary>
        /// The <see cref="OfflineTimer" /> property's name.
        /// </summary>
        public const string OfflineTimerPropertyName = "OfflineTimer";

        private string _offlineTimer = "";

        /// <summary>
        /// Sets and gets the OfflineTimer property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string OfflineTimer
        {
            get
            {
                return _offlineTimer;
            }

            set
            {
                if (_offlineTimer == value)
                {
                    return;
                }

                _offlineTimer = value;
                RaisePropertyChanged(OfflineTimerPropertyName);
            }
        }

        //public Visibility OfflineTimerVisibility { get; set; }
        /// <summary>
        /// The <see cref="OfflineTimerVisibility" /> property's name.
        /// </summary>
        public const string OfflineTimerVisibilityPropertyName = "OfflineTimerVisibility";

        private Visibility _offlineTimerVisibility = Visibility.Collapsed;

        /// <summary>
        /// Sets and gets the OfflineTimerVisibility property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public Visibility OfflineTimerVisibility
        {
            get
            {
                return _offlineTimerVisibility;
            }

            set
            {
                if (_offlineTimerVisibility == value)
                {
                    return;
                }

                _offlineTimerVisibility = value;
                RaisePropertyChanged(OfflineTimerVisibilityPropertyName);
            }
        }
    }
}